<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="/templates/interno.xhtml">
	<ui:define name="corpo">

		<h:form id="form">


			<h:panelGrid columns="2">
				<h:outputLabel value="Cep" />
				<h:inputText value="#{enderecoBean.endereco.cep}">
					<f:ajax event="change" listener="#{enderecoBean.buscaPorCep}"
						render="form" />
				</h:inputText>

				<h:outputLabel value="Endereco" />
				<h:inputText value="#{enderecoBean.endereco.endereco}" />
				
				<h:outputLabel value="Bairro" />
				<h:inputText value="#{enderecoBean.endereco.bairro.bairro}" />
				
				<h:outputLabel value="Cidade" />
				<h:inputText value="#{enderecoBean.endereco.cidade.cidade}" />
				
				<h:outputLabel value="UF" />
				<h:inputText value="#{enderecoBean.endereco.cidade.uf}" />

			</h:panelGrid>





		</h:form>

	</ui:define>
</ui:composition>

</html>